package com.cn.kehong.controller;


import com.cn.kehong.api.IProductSaojieGuanService;
import com.cn.kehong.domain.ProductSaojieGuan;
import com.cn.kehong.utils.JsonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/saojieGuan")
public class ProductSaojieGuanController {

    @Autowired
    private IProductSaojieGuanService productSaojieGuanService;

    @RequestMapping("/getProductSaojieGuanList/{frontToken}")
    @ResponseBody
    public JsonResponse<List<ProductSaojieGuan>> getProductSaojieGuanList(String factoryName, @PathVariable(value = "frontToken",required = true) String frontToken) throws Exception {
        JsonResponse<List<ProductSaojieGuan> > response = new JsonResponse<List<ProductSaojieGuan> >();
        List<ProductSaojieGuan> lists = productSaojieGuanService.getProductSaojieGuanList(factoryName);
        response.setResult(lists);
        response.setSuccess(true);
        return  response;
    }
}
